/*
 * @Description: 优先级
 * 
 * @Author: rendc
 * 
 * @Date: 2025-08-19 14:05:21
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-08-19 14:48:56
 */

public class Test04 {
  public static void main(String[] args) {
    Thread t1 = new Thread() {
      @Override
      public void run() {
        for (int i = 0; i < 1000000000; i++) {
          if (i % 5000 == 0) {
            System.out.println("t1-i:" + i);
          }
        }
      }
    };
    Thread t2 = new Thread(
        new Runnable() {
          @Override
          public void run() {
            for (int i = 0; i < 1000000000; i++) {
              if (i % 5000 == 0) {
                System.out.println("t2-i:" + i);
              }
            }
          }
        });
    // 修改优先级
    // Math.PI;
    t2.setPriority(Thread.MAX_PRIORITY); // 10
    t1.setPriority(1); // 1
    t1.start();
    t2.start();
    // System.out.println("t1.getPriority():" + t1.getPriority());
    // System.out.println("t2.getPriority():" + t2.getPriority());
  }
}